<?php
/**
 * Mechanism
 * 
 * LICENSE
 * 
 * This file is private intellectual property of the author. 
 * All rights reserved. Copying and illegal using is punishable by law.
 * 
 * @copyright Copyright (c) 2011 BreatheInMyVoid ( BreatheInMyVoid@gmail.com )
 */

namespace Mechanism {
	use Gear\IGear;
	abstract class Mechanism implements IMechanism {
		/**
		 * Standart gears storage
		 * 
		 * Gears stored in multidimensional array
		 *     $gears['name'] = array( 'stages' => Stages,
		 *						  	   'gear'   => Gear );
		 * 
		 * @var array
		 */
		protected $gears = array( );
		 
		/**
		 * Standart gears loading strategy
		 * 
		 * @param string $name
		 * @param array $args
		 */
		public function __call( $name, $args ) {
			echo 'Calling ' . $name;
		}
		
		/**
		 * Add gear
		 * 
		 * @param srting $name
		 * @param mixed $stages
		 * @param Mechanism\Gear\IGear $gear
		 */ 
		public function add_gear( $name, $stages, IGear $gear ) {
			$this->gears[$name] = array( 'stage' => $stages, 
										 'gear'  => $gear );
		}
		
		public function get_gear( $name ) {
			return $this->gears[$name];
		}
	}
}